package org.csu.pm.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;

/**
 * @TableName book_info
 */
@TableName(value = "book_info")
@Data
public class BookInfo implements Serializable {
    /**
     * 物理主键
     */
    @TableId(value = "id")
    private Long id;

    /**
     *
     */
    @TableField(value = "user_id")
    private Long user_id;

    /**
     *
     */
    @TableField(value = "room_id")
    private Long room_id;

    /**
     *
     */
    @TableField(value = "description")
    private String description;

    @TableField(value = "begin")
    private int begin;

    @TableField(value = "length")
    private int length;

//    /**
//     * 开始时间
//     */
//    @TableField(value = "from_time")
//    private LocalDateTime from_time;
//
//    /**
//     * 结束时间
//     */
//    @TableField(value = "to_time")
//    private LocalDateTime to_time;

    /**
     * 预约信息的状态
     */
    @TableField(value = "status")
    private Integer status;

    @TableField(exist = false)
    private static final long serialVersionUID = 4301237431277667585L;

//    @Override
//    public boolean equals(Object that) {
//        if (this == that) {
//            return true;
//        }
//        if (that == null) {
//            return false;
//        }
//        if (getClass() != that.getClass()) {
//            return false;
//        }
//        BookInfo other = (BookInfo) that;
//        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
//                && (this.getUser_id() == null ? other.getUser_id() == null : this.getUser_id().equals(other.getUser_id()))
//                && (this.getRoom_id() == null ? other.getRoom_id() == null : this.getRoom_id().equals(other.getRoom_id()))
//                && (this.getDesc() == null ? other.getDesc() == null : this.getDesc().equals(other.getDesc()))
//                && (this.getFrom_time() == null ? other.getFrom_time() == null : this.getFrom_time().equals(other.getFrom_time()))
//                && (this.getTo_time() == null ? other.getTo_time() == null : this.getTo_time().equals(other.getTo_time()))
//                && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()));
//    }

//    @Override
//    public int hashCode() {
//        final int prime = 31;
//        int result = 1;
//        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
//        result = prime * result + ((getUser_id() == null) ? 0 : getUser_id().hashCode());
//        result = prime * result + ((getRoom_id() == null) ? 0 : getRoom_id().hashCode());
//        result = prime * result + ((getDesc() == null) ? 0 : getDesc().hashCode());
//        result = prime * result + ((getFrom_time() == null) ? 0 : getFrom_time().hashCode());
//        result = prime * result + ((getTo_time() == null) ? 0 : getTo_time().hashCode());
//        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
//        return result;
//    }

//    @Override
//    public String toString() {
//        StringBuilder sb = new StringBuilder();
//        sb.append(getClass().getSimpleName());
//        sb.append(" [");
//        sb.append("Hash = ").append(hashCode());
//        sb.append(", id=").append(id);
//        sb.append(", user_id=").append(user_id);
//        sb.append(", room_id=").append(room_id);
//        sb.append(", desc=").append(desc);
//        sb.append(", from_time=").append(from_time);
//        sb.append(", to_time=").append(to_time);
//        sb.append(", status=").append(status);
//        sb.append(", serialVersionUID=").append(serialVersionUID);
//        sb.append("]");
//        return sb.toString();
//    }


    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getUser_id() {
        return user_id;
    }

    public void setUser_id(Long user_id) {
        this.user_id = user_id;
    }

    public Long getRoom_id() {
        return room_id;
    }

    public void setRoom_id(Long room_id) {
        this.room_id = room_id;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public int getBegin() {
        return begin;
    }

    public void setBegin(int begin) {
        this.begin = begin;
    }

    public int getLength() {
        return length;
    }

    public void setLength(int length) {
        this.length = length;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }
}